<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>Ruoyi学习02：项目中的Vue常用业务 | CHRIS YANG</title><meta name="author" content="Chris"><meta name="copyright" content="Chris"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="上一节主要是为了记录学习过程，留给以后忘记的时候参考，当然那个时候都不知道还记不记得这个博客，这一节就简单明了的直接上常用的业务了。 配置路由首先要有一个页面，可以放在views文件夹下，找地方放，然后配置在&#x2F;src&#x2F;router&#x2F;index.js文件中进行，找到其公共路由部分加入配置，例如下面这段： 12345&amp;#123;  path: &amp;#x27;&#x2F;map&amp;#x2">
<meta property="og:type" content="article">
<meta property="og:title" content="Ruoyi学习02：项目中的Vue常用业务">
<meta property="og:url" content="https://strangerider.gitee.io/2023/07/20/Ruoyi02/index.html">
<meta property="og:site_name" content="CHRIS YANG">
<meta property="og:description" content="上一节主要是为了记录学习过程，留给以后忘记的时候参考，当然那个时候都不知道还记不记得这个博客，这一节就简单明了的直接上常用的业务了。 配置路由首先要有一个页面，可以放在views文件夹下，找地方放，然后配置在&#x2F;src&#x2F;router&#x2F;index.js文件中进行，找到其公共路由部分加入配置，例如下面这段： 12345&amp;#123;  path: &amp;#x27;&#x2F;map&amp;#x2">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://strangerider.gitee.io/images/lueluelue.gif">
<meta property="article:published_time" content="2023-07-20T08:51:19.370Z">
<meta property="article:modified_time" content="2023-07-20T09:57:13.633Z">
<meta property="article:author" content="Chris">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://strangerider.gitee.io/images/lueluelue.gif"><link rel="shortcut icon" href="/images/love.gif"><link rel="canonical" href="https://strangerider.gitee.io/2023/07/20/Ruoyi02/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
  root: '/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  dateSuffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false,
  percent: {
    toc: true,
    rightside: false,
  },
  autoDarkmode: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'Ruoyi学习02：项目中的Vue常用业务',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2023-07-20 17:57:13'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
    win.getCSS = (url,id = false) => new Promise((resolve, reject) => {
      const link = document.createElement('link')
      link.rel = 'stylesheet'
      link.href = url
      if (id) link.id = id
      link.onerror = reject
      link.onload = link.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        link.onload = link.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(link)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 6.3.0"></head><body><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/images/lueluelue.gif" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">4</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">0</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">0</div></a></div><hr class="custom-hr"/></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background: #00000000"><nav id="nav"><span id="blog-info"><a href="/" title="CHRIS YANG"><span class="site-name">CHRIS YANG</span></a></span><div id="menus"><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">Ruoyi学习02：项目中的Vue常用业务</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2023-07-20T08:51:19.370Z" title="发表于 2023-07-20 16:51:19">2023-07-20</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2023-07-20T09:57:13.633Z" title="更新于 2023-07-20 17:57:13">2023-07-20</time></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="Ruoyi学习02：项目中的Vue常用业务"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><p>上一节主要是为了记录学习过程，留给以后忘记的时候参考，当然那个时候都不知道还记不记得这个博客，这一节就简单明了的直接上常用的业务了。</p>
<h2 id="配置路由"><a href="#配置路由" class="headerlink" title="配置路由"></a>配置路由</h2><p>首先要有一个页面，可以放在views文件夹下，找地方放，然后配置在&#x2F;src&#x2F;router&#x2F;index.js文件中进行，找到其公共路由部分加入配置，例如下面这段：</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">  <span class="attr">path</span>: <span class="string">&#x27;/map&#x27;</span>,</span><br><span class="line">  <span class="attr">component</span>: <span class="function">() =&gt;</span> <span class="keyword">import</span>(<span class="string">&#x27;@/views/system/mapbox/MapBox&#x27;</span>),</span><br><span class="line">  <span class="attr">hidden</span>: <span class="literal">true</span></span><br><span class="line">&#125;,</span><br></pre></td></tr></table></figure>

<p>那动态路由是什么呢？就是把路由的路径存在文件里，通过后端发送过来，而在前端使用组件递归等形式读取文件生成按钮，并根据文件去决定到路由到的页面。</p>
<h2 id="GET和POST接口配置"><a href="#GET和POST接口配置" class="headerlink" title="GET和POST接口配置"></a>GET和POST接口配置</h2><p>前端接口都是写在对应的业务逻辑js文件中的，以函数形式封装每个接口，函数返回值为一个请求，所以还要引用request</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> request <span class="keyword">from</span> <span class="string">&#x27;@/utils/request&#x27;</span></span><br></pre></td></tr></table></figure>

<h3 id="前端GET接口"><a href="#前端GET接口" class="headerlink" title="前端GET接口"></a>前端GET接口</h3><p>所以啥是token呢？<br>以获取验证码接口为例:</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 获取验证码</span></span><br><span class="line"><span class="keyword">export</span> <span class="keyword">function</span> <span class="title function_">getCodeImg</span>(<span class="params"></span>) &#123;</span><br><span class="line">    <span class="keyword">return</span> <span class="title function_">request</span>(&#123;</span><br><span class="line">        <span class="attr">url</span>: <span class="string">&#x27;/captchaImage&#x27;</span>,</span><br><span class="line">        <span class="attr">headers</span>: &#123;</span><br><span class="line">            <span class="attr">isToken</span>: <span class="literal">false</span></span><br><span class="line">        &#125;,</span><br><span class="line">        <span class="attr">method</span>: <span class="string">&#x27;get&#x27;</span>,</span><br><span class="line">        <span class="attr">timeout</span>: <span class="number">20000</span></span><br><span class="line">    &#125;)</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="前端POST接口"><a href="#前端POST接口" class="headerlink" title="前端POST接口"></a>前端POST接口</h3><p>post接口主要是数据是包在body内的，但是返回的request的data只能指定为一个对象，所以应该把参数都封装为一个对象传入data，以登录接口为例：</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 登录方法</span></span><br><span class="line"><span class="keyword">export</span> <span class="keyword">function</span> <span class="title function_">login</span>(<span class="params">username, password, code, uuid</span>) &#123;</span><br><span class="line">    <span class="keyword">const</span> data = &#123;</span><br><span class="line">        username,</span><br><span class="line">        password,</span><br><span class="line">        code, </span><br><span class="line">        uuid</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">return</span> <span class="title function_">request</span>(&#123;</span><br><span class="line">        <span class="attr">url</span>: <span class="string">&#x27;/login&#x27;</span>,</span><br><span class="line">        <span class="attr">headers</span>: &#123;</span><br><span class="line">            <span class="attr">isToken</span>: <span class="literal">false</span></span><br><span class="line">        &#125;,</span><br><span class="line">        <span class="attr">method</span>: <span class="string">&#x27;post&#x27;</span>,</span><br><span class="line">        <span class="attr">data</span>: data</span><br><span class="line">    &#125;)</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="前端发送请求"><a href="#前端发送请求" class="headerlink" title="前端发送请求"></a>前端发送请求</h3><p>直接调用函数传参就可以，之后可以.then()来拿到返回的response里的数据</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="title function_">requestFunction</span>(params)</span><br><span class="line">    .<span class="title function_">then</span>(<span class="function"><span class="params">response</span> =&gt;</span> &#123;  &#125;);</span><br></pre></td></tr></table></figure>

<h2 id="使用Apifox模拟配合前端开发"><a href="#使用Apifox模拟配合前端开发" class="headerlink" title="使用Apifox模拟配合前端开发"></a>使用Apifox模拟配合前端开发</h2><h3 id="GET请求接口"><a href="#GET请求接口" class="headerlink" title="GET请求接口"></a>GET请求接口</h3><p>只需要写上url，比如&#x2F;captchaImage，然后写好返回响应就好了，可以按照案例的请求响应来看结构并写对应的返回响应</p>
<h3 id="POST请求接口"><a href="#POST请求接口" class="headerlink" title="POST请求接口"></a>POST请求接口</h3><p>与GET不同的是需要在body部分配置接口应该受到的参数值</p>
<h3 id="前端拦截请求转向Apifox代理"><a href="#前端拦截请求转向Apifox代理" class="headerlink" title="前端拦截请求转向Apifox代理"></a>前端拦截请求转向Apifox代理</h3><p>首先前端在request.js中的service.interceptors.request.use()函数中添加拦截，对请求进行特殊标记，比如修改baseURL，如下：</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">service.<span class="property">interceptors</span>.<span class="property">request</span>.<span class="title function_">use</span>(<span class="function"><span class="params">config</span> =&gt;</span> &#123;</span><br><span class="line">    <span class="comment">// 拦截接口并添加标记</span></span><br><span class="line">    <span class="keyword">if</span> ([<span class="string">&#x27;/url名&#x27;</span>].<span class="title function_">includes</span>(config.<span class="property">url</span>)) &#123;</span><br><span class="line">        config.<span class="property">baseURL</span> = <span class="string">&quot;/标记名&quot;</span></span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="comment">// 以/getMapData为例，使其baseURL变为/apifox</span></span><br><span class="line">    <span class="keyword">if</span> ([<span class="string">&#x27;/getMapData&#x27;</span>].<span class="title function_">includes</span>(config.<span class="property">url</span>)) &#123;</span><br><span class="line">        config.<span class="property">baseURL</span> = <span class="string">&quot;/apifox&quot;</span></span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    ......</span><br><span class="line">&#125;)</span><br></pre></td></tr></table></figure>

<p>然后在vue.config.js里添加匹配分发到Apifox分配的baseUrl中，baseURL可以在Apifox的接口文档里面找到，对于一个项目的接口，baseURL都是一样的。</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">proxy</span>: &#123;</span><br><span class="line">    ......</span><br><span class="line">    ,</span><br><span class="line">    <span class="string">&quot;/apifox&quot;</span>: &#123;</span><br><span class="line">        <span class="attr">target</span>: <span class="string">`http://127.0.0.1:4523/m1/3011311-0-default`</span>,</span><br><span class="line">        <span class="attr">changeOrigin</span>: <span class="literal">true</span>,</span><br><span class="line">        <span class="attr">pathRewrite</span>: &#123;</span><br><span class="line">        <span class="string">&quot;/apifox&quot;</span>: <span class="string">&#x27;&#x27;</span></span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;,</span><br></pre></td></tr></table></figure>

<p>此时前端即可发送请求向Apifox请求数据了。<br><em>注：在使用Apifox模拟后端接口过程中接口要保持运行状态</em></p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="https://strangerider.gitee.io">Chris</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://strangerider.gitee.io/2023/07/20/Ruoyi02/">https://strangerider.gitee.io/2023/07/20/Ruoyi02/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://strangerider.gitee.io" target="_blank">CHRIS YANG</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"></div><div class="post_share"><div class="social-share" data-image="/images/lueluelue.gif" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2023/07/24/%E5%8D%9A%E5%AE%A2%E9%83%A8%E7%BD%B2_Gitee/" title="部署博客（Gitee）"><div class="cover" style="background: var(--default-bg-color)"></div><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">部署博客（Gitee）</div></div></a></div><div class="next-post pull-right"><a href="/2023/07/20/Ruoyi01/" title="Ruoyi学习01：跑起项目与调整API转发"><div class="cover" style="background: var(--default-bg-color)"></div><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">Ruoyi学习01：跑起项目与调整API转发</div></div></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="/images/lueluelue.gif" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">Chris</div><div class="author-info__description"></div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">4</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">0</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">0</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/xxxxxx"><i class="fab fa-github"></i><span>Follow Me</span></a></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%85%8D%E7%BD%AE%E8%B7%AF%E7%94%B1"><span class="toc-number">1.</span> <span class="toc-text">配置路由</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#GET%E5%92%8CPOST%E6%8E%A5%E5%8F%A3%E9%85%8D%E7%BD%AE"><span class="toc-number">2.</span> <span class="toc-text">GET和POST接口配置</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%89%8D%E7%AB%AFGET%E6%8E%A5%E5%8F%A3"><span class="toc-number">2.1.</span> <span class="toc-text">前端GET接口</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%89%8D%E7%AB%AFPOST%E6%8E%A5%E5%8F%A3"><span class="toc-number">2.2.</span> <span class="toc-text">前端POST接口</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%89%8D%E7%AB%AF%E5%8F%91%E9%80%81%E8%AF%B7%E6%B1%82"><span class="toc-number">2.3.</span> <span class="toc-text">前端发送请求</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BD%BF%E7%94%A8Apifox%E6%A8%A1%E6%8B%9F%E9%85%8D%E5%90%88%E5%89%8D%E7%AB%AF%E5%BC%80%E5%8F%91"><span class="toc-number">3.</span> <span class="toc-text">使用Apifox模拟配合前端开发</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#GET%E8%AF%B7%E6%B1%82%E6%8E%A5%E5%8F%A3"><span class="toc-number">3.1.</span> <span class="toc-text">GET请求接口</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#POST%E8%AF%B7%E6%B1%82%E6%8E%A5%E5%8F%A3"><span class="toc-number">3.2.</span> <span class="toc-text">POST请求接口</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%89%8D%E7%AB%AF%E6%8B%A6%E6%88%AA%E8%AF%B7%E6%B1%82%E8%BD%AC%E5%90%91Apifox%E4%BB%A3%E7%90%86"><span class="toc-number">3.3.</span> <span class="toc-text">前端拦截请求转向Apifox代理</span></a></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/07/24/%E5%8D%9A%E5%AE%A2%E9%83%A8%E7%BD%B2_Gitee/" title="部署博客（Gitee）">部署博客（Gitee）</a><time datetime="2023-07-24T07:14:45.808Z" title="发表于 2023-07-24 15:14:45">2023-07-24</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/07/20/Ruoyi02/" title="Ruoyi学习02：项目中的Vue常用业务">Ruoyi学习02：项目中的Vue常用业务</a><time datetime="2023-07-20T08:51:19.370Z" title="发表于 2023-07-20 16:51:19">2023-07-20</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/07/20/Ruoyi01/" title="Ruoyi学习01：跑起项目与调整API转发">Ruoyi学习01：跑起项目与调整API转发</a><time datetime="2023-07-20T03:35:44.513Z" title="发表于 2023-07-20 11:35:44">2023-07-20</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/07/18/hello-world/" title="Hexo Light Document">Hexo Light Document</a><time datetime="2023-07-18T03:04:49.746Z" title="发表于 2023-07-18 11:04:49">2023-07-18</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2023 By Chris</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.umd.min.js"></script><div class="js-pjax"></div><script id="click-show-text" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/click-show-text.min.js" data-mobile="true" data-text="喵呜" data-fontsize="20px" data-random="false" async="async"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>